import * as React from 'react';
import {
  NewFriend, 
  Forget, 
  Login, 
  Register, 
  VerifyCode, 
  Demo, 
  PersonalHomePage, 
  Message, 
  Chating, 
  Contacts, 
  TabBar,
  AddFriend, 
  SearchFriend,
  Profile,
  ProfileSettings
} from '../pages'

import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';

const NavigatorList = [
  {name: 'Register', component: Register},
  {name: 'Login', component: Login},
  {name: 'Forget', component: Forget},
  {name: 'VerifyCode', component: VerifyCode},
  {name: 'PersonalHomePage', component: PersonalHomePage},
  {name: 'Message', component: Message},
  {name: 'Chating', component: Chating},
  {name: 'TabBar', component: TabBar},
  {name: 'Demo', component: Demo},
  {name: 'Contacts',component: Contacts},
  {name: 'Addfriend', component: AddFriend},
  {name: 'SearchFriend', component: SearchFriend},
  {name: 'NewFriend', component: NewFriend},
  {name: 'Profile', component: Profile},
  {name: 'ProfileSettings', component: ProfileSettings},

]


const Stack = createStackNavigator();

export default function Index() {
  return (
    <NavigationContainer>
      <Stack.Navigator headerMode='none' initialRouteName='Demo'>
        {
          NavigatorList.map(item=>(
            <Stack.Screen key={item.name} name={item.name} component={item.component} />
          ))
        }
        
      </Stack.Navigator>
    </NavigationContainer>
  );
}

